package cn.yujiago.miaosha.service;

import cn.yujiago.miaosha.dto.GoodsDTO;
import cn.yujiago.miaosha.dto.Result;
import cn.yujiago.miaosha.entity.Goods;
import cn.yujiago.miaosha.entity.Order;
import cn.yujiago.miaosha.entity.User;

import java.awt.image.BufferedImage;
import java.util.List;

public interface MiaoshaService {

    // 获取秒杀列表
    Result<List<GoodsDTO>> getMiaoshaList();

    // 获取验证码图片
    BufferedImage createVerifyCode(User user, Long goodsId);
    // 检查验证码
    boolean checkVerifyCode(User user, Long goodsId, String verifyCode);

    // 生成随机秒杀URL路径
    String createMiaoshaPath(Long userId, Long goodsId);
    // 检查秒杀URL路径是否匹配
    boolean checkPath(Long userId, Long goodsId, String path);

    // 进行秒杀
    Order miaosha(Long userId, GoodsDTO goods);

    // 查询秒杀结果
    Long getMiaoshaResult(Long userId, Long goodsId);
}
